package robocup.component.coach;

import java.util.Vector;

import robocup.component.AbstractAgent;
import robocup.component.PConf;
import robocup.component.SConf;
import robocup.component.ControllerNumbers.PLAY_MODE;
import robocup.component.geometry.Vektor;
import robocup.component.infotypes.AuralInfo;
import robocup.component.infotypes.CoachBallInfo;
import robocup.component.infotypes.CoachPlayerInfo;
import robocup.component.infotypes.CoachVisualInfo;
import robocup.component.infotypes.PlayModeInfo;
import robocup.component.speechacts.MessageFactory;
import robocup.component.worldobjects.Ball;
import robocup.component.worldobjects.Player;

/**
 * <code>CoachWorld</code>
 * 
 * @author Grzegorz Lehmann
 */
public class CoachWorld {

  private CoachFactBase  myFactBase;

  private AbstractAgent  myMaster;

  private int            visualCycle = -1;

  private PLAY_MODE      playMode    = PLAY_MODE.BEFORE_KICK_OFF;

  private int            ownGoals    = 0;

  private int            oppGoals    = 0;

  private Player[]       teammates   = new Player[11];

  private Player[]       opponents   = new Player[11];

  private Ball           ball        = null;

  private SConf          sConf;

  private PConf          pConf;

  private PConf[]        playerTypes = null;

  private MessageFactory mf          = null;

  private int            serverCycle = -1;

  private int            playOnCycle = 0;

  /**
   * <code>CoachWorld</code> constructor
   * 
   * @param myFB
   */
  public CoachWorld(
      final CoachFactBase myFB) {

    this.myFactBase = myFB;
    for (int i = 0; i < 11; i++) {
      this.teammates[i] = new Player(-1, -1, i + 1, new Vektor(Vektor.XY, -999,
          -999), new Vektor(), 0, 0, 0, 0, 0, false, true, false, new PConf());
      this.opponents[i] = new Player(-1, -1, i + 1, new Vektor(Vektor.XY, -999,
          -999), new Vektor(), 0, 0, 0, 0, 0, false, false, false, new PConf());
    }
    this.ball = new Ball(0, 0, new Vektor(), new Vektor());
    this.sConf = SConf.getInstance();
    this.pConf = new PConf();
    this.mf = new MessageFactory();
  }

  /**
   * <code>setParent</code>
   * 
   * @param bean
   */
  public void setParent(final AbstractAgent bean) {

    this.myMaster = bean;
  }

  /**
   * Retrieves the agent instance
   */
  public AbstractAgent getParent() {

    return this.myMaster;
  }

  /**
   * <code>update</code>
   * 
   * @param cvi
   */
  public void update(final CoachVisualInfo cvi) {

    if (cvi != null) {
      this.myFactBase.update(cvi);
      // updateTeammatesHistory(this.teammates);
      // updateOpponentsHistory(this.opponents);
      // updateBallHistory(this.ball);

      this.visualCycle = cvi.getCycle();
      this.serverCycle++;
      if (this.playMode == PLAY_MODE.PLAY_ON) {
        this.playOnCycle++;
      }
      else {
        this.playOnCycle = 0;
      }
      if (this.playOnCycle == (this.sConf.FREEFORM_SEND_PERIOD + this.sConf.FREEFORM_WAIT_PERIOD)) {
        this.playOnCycle = this.sConf.FREEFORM_SEND_PERIOD;
        // this.teammates = new CoachPlayerInfo[11];
        // this.opponents = new CoachPlayerInfo[11];
      }

      CoachPlayerInfo[] temp = cvi.getOwnPlayers();
      // System.out.println("CoachWorld teammates: " + temp.length);
      for (int i = 0; i < temp.length; i++) {

        final int nr = temp[i].getPlayerNumber() - 1;
        if (nr < 11) {
          // update the players
          this.teammates[nr].setCycle(this.visualCycle);
          this.teammates[nr].setBodyDir(temp[i].getBodyAngle());
          this.teammates[nr].setNeckAngle(temp[i].getNeckAngle());
          //this.teammates[nr].setPointDirection(temp[i].getPointDirection());
          this.teammates[nr].getPosition().x = temp[i].getXPos();
          this.teammates[nr].getPosition().y = temp[i].getYPos();
          this.teammates[nr].getSpeed().x = temp[i].getXSpeed();
          this.teammates[nr].getSpeed().y = temp[i].getYSpeed();
          this.teammates[nr].setGoalie(temp[i].isGoalie());
        }
        else {
          System.out
              .println("CoachWorld received teammate with (number > 11):" + nr);
        }
      }

      temp = cvi.getOtherPlayers();
      for (int i = 0; i < temp.length; i++) {
        final int nr = temp[i].getPlayerNumber() - 1;
        if (nr < 11) {
          // update the opps
          this.opponents[nr].setCycle(this.visualCycle);
          this.opponents[nr].setBodyDir(temp[i].getBodyAngle());
          this.opponents[nr].setNeckAngle(temp[i].getNeckAngle());
          this.opponents[nr].getPosition().x = temp[i].getXPos();
          this.opponents[nr].getPosition().y = temp[i].getYPos();
          this.opponents[nr].getSpeed().x = temp[i].getXSpeed();
          this.opponents[nr].getSpeed().y = temp[i].getYSpeed();
          this.opponents[nr].setGoalie(temp[i].isGoalie());
        }
        else {
          System.out
              .println("CoachWorld received opponent with (number > 11):" + nr);
        }
      }

      // update the ball
      final CoachBallInfo cbi = cvi.getCoachBall();
      this.ball.setCycle(cvi.getCycle());
      this.ball.getPosition().x = cbi.getXPos();
      this.ball.getPosition().y = cbi.getYPos();
      this.ball.getSpeed().x = cbi.getXSpeed();
      this.ball.getSpeed().y = cbi.getYSpeed();

    }
  }

  /**
   * <code>update</code>
   * 
   * @param info
   */
  public void update(final AuralInfo info) {

    if (info instanceof PlayModeInfo) {
      this.myFactBase.update(info);
      final PlayModeInfo pmi = (PlayModeInfo) info;
      this.playMode = pmi.getPlayModeType();
      if (this.playMode == PLAY_MODE.GOAL_OTHER) {
        this.oppGoals++;
      }
      if (this.playMode == PLAY_MODE.GOAL_OWN) {
        this.ownGoals++;
      }
    }
  }

  /**
   * <code>getPlayerPosition</code>
   * 
   * @param number
   *          number of the player
   * @param isFriend
   *          true if player is a friendly, false otherwise
   * @return Vektor - position of the player
   */
  public Vektor getPlayerPosition(final int number,
      final boolean isFriend) {

    return (isFriend) ? this.getTeammatePosition(number) : this
        .getOpponentPosition(number);
  }

  /**
   * <code>getTeammatePosition</code>
   * 
   * @param number
   *          number of the player
   * @return Vektor - position of the friendly player
   */
  public final Vektor getTeammatePosition(final int number) {

    if (this.teammates[number - 1] == null) {
      return null;
    }
    //		
    // double x = this.teammates[number-1].getXPos();
    // double y = this.teammates[number-1].getYPos();
    // return new Vektor(Vektor.XY, x, y);
    return this.teammates[number - 1].getPosition().cloned();
  }

  /**
   * <code>getOpponentPosition</code>
   * 
   * @param number
   *          number of the player
   * @return Vektor - position of the enemy player
   */
  public final Vektor getOpponentPosition(final int number) {

    if (this.opponents[number - 1] == null) {
      return null;
    }
    //		
    // double x = this.opponents[number-1].getXPos();
    // double y = this.opponents[number-1].getYPos();
    // return new Vektor(Vektor.XY, x, y);

    return this.opponents[number - 1].getPosition().cloned();
  }

  /**
   * <code>getPlayerSpeed</code>
   * 
   * @param number
   *          number of the player
   * @param isFriend
   *          true if player is a friendly, false otherwise
   * @return Vektor - speed of the player
   */
  public Vektor getPlayerSpeed(final int number,
      final boolean isFriend) {

    // return (isFriend) ? getTeammateSpeed(number) :
    // getOpponentSpeed(number);
    if (number > 11) {
      return null;
    }
    Player p = null;
    if (isFriend) {
      p = this.teammates[number - 1];
    }
    else {
      p = this.opponents[number - 1];
    }
    return p.getSpeed().cloned();
  }

  /**
   * <code>getTeammateSpeed</code>
   * 
   * @param number
   *          number of the player
   * @return Vektor - speed of the friendly player
   */
  // public final Vektor getTeammateSpeed(int number) {
  // if (this.teammates[number-1] == null) {
  // return null;
  // }
  //	
  // double x = this.teammates[number-1].getXSpeed();
  // double y = this.teammates[number-1].getYSpeed();
  // return new Vektor(Vektor.XY, x, y);
  // }
  /**
   * <code>getOpponentSpeed</code>
   * 
   * @param number
   *          number of the player
   * @return Vektor - speed of the enemy player
   */
  // public final Vektor getOpponentSpeed(int number) {
  // if (this.opponents[number-1] == null) {
  // return null;
  // }
  //	
  // double x = this.opponents[number-1].getXSpeed();
  // double y = this.opponents[number-1].getYSpeed();
  // return new Vektor(Vektor.XY, x, y);
  // }
  /**
   * <code>getBallPosition</code>
   * 
   * @return Vektor - position of the ball
   */
  public final Vektor getBallPosition() {

    // return (this.ball == null)
    // ? null
    // : new Vektor(Vektor.XY, this.ball.getXPos(), this.ball.getYPos());
    return this.ball.getPosition().cloned();
  }

  /**
   * Getter for the ball. (hope this is correct)
   * 
   * @author Paul
   * @return The ball.
   */
  public Ball getBall() {

    // return (this.ball == null)
    // ? new Ball(this.visualCycle, this.visualCycle, new Vektor(), new
    // Vektor())
    // : new Ball(this.visualCycle, this.visualCycle, new Vektor(Vektor.XY,
    // this.ball
    // .getXPos(), this.ball.getYPos()), new Vektor(Vektor.XY,
    // this.ball.getXSpeed(), this.ball.getYSpeed()));
    return this.ball.cloned();
  }

  /**
   * <code>getBallVelocity</code>
   * 
   * @return Vektor - velocity of the ball
   */
  public final Vektor getBallVelocity() {

    // return (this.ball == null)
    // ? null
    // : new Vektor(Vektor.XY, this.ball.getXSpeed(),
    // this.ball.getYSpeed());
    return this.ball.getSpeed().cloned();
  }

  /**
   * <code>getPlayerHA</code>
   * 
   * @param number
   *          number of the player
   * @param isFriend
   *          true if player is a friendly, false otherwise
   * @return double - head angle of the player
   */
  public double getPlayerHA(final int number,
      final boolean isFriend) {

    // return (isFriend) ? getTeammateHA(number) : getOpponentHA(number);
    if (number > 11) {
      return 0;
    }
    Player p = null;
    if (isFriend) {
      p = this.teammates[number - 1];
    }
    else {
      p = this.opponents[number - 1];
    }
    return p.getNeckAngle();
  }

  /**
   * <code>getTeammateHA</code>
   * 
   * @param number
   *          number of the player
   * @return double - head angle of the friendly player
   */
  // public final double getTeammateHA(int number) {
  // if (this.teammates[number-1] == null) {
  // return Double.NaN;
  // }
  //	
  // return this.teammates[number-1].getBodyAngle() +
  // this.teammates[number-1].getNeckAngle();
  // }
  /**
   * <code>getOpponentHA</code>
   * 
   * @param number
   *          number of the player
   * @return double - head angle of the enemy player
   */
  // public final double getOpponentHA(int number) {
  // if (this.opponents[number-1] == null) {
  // return Double.NaN;
  // }
  //	
  // return this.opponents[number-1].getBodyAngle() +
  // this.opponents[number-1].getNeckAngle();
  // }
  /**
   * <code>getPlayerBA</code>
   * 
   * @param number
   *          number of the player
   * @param isFriend
   *          true if player is a friendly, false otherwise
   * @return double - body angle of the player
   */
  public double getPlayerBA(final int number,
      final boolean isFriend) {

    // return (isFriend) ? getTeammateBA(number) : getOpponentBA(number);
    if (number > 11) {
      return 0;
    }
    Player p = null;
    if (isFriend) {
      p = this.teammates[number - 1];
    }
    else {
      p = this.opponents[number - 1];
    }
    return p.getBodyDir();
  }

  /**
   * <code>getTeammateBA</code>
   * 
   * @param number
   *          number of the player
   * @return double - body angle of the friendly player
   */
  // public final double getTeammateBA(int number) {
  // if (this.teammates[number-1] == null) {
  // return Double.NaN;
  // }
  //	
  // return this.teammates[number-1].getBodyAngle();
  // }
  /**
   * <code>getOpponentBA</code>
   * 
   * @param number
   *          number of the player
   * @return double - body angle of the enemy player
   */
  // public final double getOpponentBA(int number) {
  // if (this.opponents[number-1] == null) {
  // return Double.NaN;
  // }
  //	
  // return this.opponents[number-1].getBodyAngle();
  // }
  /**
   * <code>getPlayerNA</code>
   * 
   * @param number
   *          number of the player
   * @param isFriend
   *          true if player is a friendly, false otherwise
   * @return double - neck angle of the player
   */
  public double getPlayerNA(final int number,
      final boolean isFriend) {

    return (isFriend) ? this.getTeammateNA(number) : this.getOpponentNA(number);
  }

  /**
   * <code>getTeammateNA</code>
   * 
   * @param number
   *          number of the player
   * @return double - neck angle of the friendly player
   */
  public final double getTeammateNA(final int number) {

    if (this.teammates[number - 1] == null) {
      return Double.NaN;
    }

    return this.teammates[number - 1].getNeckAngle();
  }

  /**
   * <code>getOpponentNA</code>
   * 
   * @param number
   *          number of the player
   * @return double - neck angle of the enemy player
   */
  public final double getOpponentNA(final int number) {

    if (this.opponents[number - 1] == null) {
      return Double.NaN;
    }

    return this.opponents[number - 1].getNeckAngle();
  }

  /**
   * <code>getVisualCycle</code> getter
   * 
   * @return Returns the visualCycle.
   */
  public final int getVisualCycle() {

    return this.visualCycle;
  }

  /**
   * <code>getTeammatesCount</code>
   * 
   * @return int - number of teammates on field
   */
  public final int getTeammatesCount() {

    int count = 0;
    for (int i = 0; i < this.teammates.length; i++) {
      if (this.teammates[i] != null) {
        count++;
      }
    }
    return count;
  }

  /**
   * <code>getOpponentsCount</code>
   * 
   * @return int - number of enemies on field
   */
  public final int getOpponentsCount() {

    int count = 0;
    for (int i = 0; i < this.opponents.length; i++) {
      if (this.opponents[i] != null) {
        count++;
      }
    }
    return count;
  }

  /**
   * <code>setPlayMode</code> setter
   * 
   * @param pMode
   *          The playMode to set.
   */
  public void setPlayMode(final PLAY_MODE pMode) {

    this.playMode = pMode;
  }

  /**
   * <code>getPlayMode</code> getter
   * 
   * @return Returns the playMode.
   */
  public PLAY_MODE getPlayMode() {

    return this.playMode;
  }

  /**
   * <code>getPlayersPositions</code>
   * 
   * @return Vector<Vektor> - positions of all players on the field
   */
  public Vector<Vektor> getPlayersPositions() {

    final Vector<Vektor> positions = new Vector<Vektor>();
    for (int i = 1; i < 12; i++) {
      Vektor pos = this.getTeammatePosition(i);
      if (pos != null) {
        positions.add(new Vektor(Vektor.XY, pos.x, pos.y));
      }
      pos = this.getOpponentPosition(i);
      if (pos != null) {
        positions.add(new Vektor(Vektor.XY, pos.x, pos.y));
      }
    }
    return positions;
  }

  /**
   * <code>existsPlayer</code>
   * 
   * @param nr
   *          number of the player
   * @param friendly
   *          true if player is a friendly, false otherwise
   * @return boolean - true if the player exists, false otherwise
   */
  public boolean existsPlayer(final int nr,
      final boolean friendly) {

    return (friendly) ? this.teammates[nr - 1].getCycle() >= 0 : this.opponents[nr - 1]
        .getCycle() >= 0;
  }

  /**
   * <code>getTeamName</code> returns a team name of a team, depending on the
   * <code>own</code> flag.
   * 
   * @param own
   *          true if own team's name wanted, otherwise false
   * @return String - team name
   */
  public final String getTeamName(final boolean own) {

    if (this.myFactBase != null) {
      final CoachVisualInfo cvi = this.myFactBase.getCurrentVI();
      if (cvi != null) {
        return (own) ? cvi.getOwnTeamName() : cvi.getOtherTeamName();
      }
    }
    return null;
  }

  /**
   * <code>getMyFactBase</code> getter
   * 
   * @return Returns the myFactBase.
   */
  public final CoachFactBase getMyFactBase() {

    return this.myFactBase;
  }

  /**
   * <code>getSConf</code> getter for the SConf
   * 
   * @return SConf - configuration of the server
   */
  public final SConf getSConf() {

    return this.sConf;
  }

  public void setSConf(final SConf conf) {

    this.sConf = conf;
  }

  public PConf getPConf() {

    return this.pConf;
  }

  public void setPConf(final PConf conf) {

    this.pConf = conf;
  }

  public Player[] getOpponents() {

    return this.opponents;
  }

  public void setOpponents(final Player[] opponents) {

    this.opponents = opponents;
  }

  public Player[] getTeammates() {

    return this.teammates;
  }

  public void setTeammates(final Player[] teammates) {

    this.teammates = teammates;
  }

  public void setBall(final Ball ball) {

    this.ball = ball;
  }

  public void setPlayerTypes(final PConf[] playerTypes) {

    this.playerTypes = playerTypes;
  }

  public PConf[] getPlayerTypes() {

    return this.playerTypes;
  }

  public int getOppGoals() {

    return this.oppGoals;
  }

  public int getOwnGoals() {

    return this.ownGoals;
  }

  public boolean isTeamEast() {

    return this.myMaster.isTeamEast();
  }

  public MessageFactory getMessageFactory() {

    return this.mf;
  }

  public int getServerCycle() {

    return this.serverCycle;
  }

  public int getPlayOnCycle() {

    return this.playOnCycle;
  }

  public void setPlayOnCycle(final int playOnCycle) {

    this.playOnCycle = playOnCycle;
  }
}

/**
 * $Log: CoachWorld.java,v $ Revision 1.7 2006/11/04 22:47:33 wetzker merged
 * source release docu - some classes still need to be merged (use compare with
 * SourceRelease) - situations, states, wm, models, clang, player, mf, ra
 * missing
 * 
 * Revision 1.6 2006/06/10 18:06:21 endert Some Changes for Coach and
 * MarkOpponent
 * 
 * Revision 1.5 2006/04/20 16:06:26 endert Updated counter for real cycles!
 * 
 * Revision 1.4 2006/04/20 16:02:56 endert MessageFactory only instanciated once
 * for each agent (player, coach and trainer). For Players and Coach, the
 * MessageFactory is placed within the WorldModel.
 * 
 * Revision 1.3 2006/04/18 03:32:42 phil added teammates pointtodirection
 * 
 * Revision 1.2 2006/03/26 21:58:50 wetzker created geometry package and moved
 * geometry classes from worldobject package there
 * 
 * Revision 1.1.2.7 2006/06/02 17:43:42 phil *** empty log message ***
 * 
 * Revision 1.1.2.6 2006/05/31 13:33:48 phil *** empty log message ***
 * 
 * Revision 1.1.2.5 2006/05/31 01:50:56 phil *** empty log message ***
 * 
 * Revision 1.1.2.4 2006/05/27 13:28:11 phil *** empty log message ***
 * 
 * Revision 1.5 2006/04/20 16:06:26 endert Updated counter for real cycles!
 * 
 * Revision 1.4 2006/04/20 16:02:56 endert MessageFactory only instanciated once
 * for each agent (player, coach and trainer). For Players and Coach, the
 * MessageFactory is placed within the WorldModel.
 * 
 * Revision 1.3 2006/04/18 03:32:42 phil added teammates pointtodirection
 * 
 * Revision 1.2 2006/03/26 21:58:50 wetzker created geometry package and moved
 * geometry classes from worldobject package there
 * 
 * Revision 1.1 2006/03/13 07:36:19 axle moved from ROOT/src for Maven 2
 * Buildsystem and Team/Soccerscope separation
 * 
 * Revision 1.20 2006/03/07 12:46:24 endert Merge after refactoring: - New
 * State-Interface: One Method for each action type - Action Bean removed -
 * ActionFactorys for helper methods, States calculate main-Action themselves -
 * formatted code - added State-List in Monitor (Context-Menu of Player) - other
 * smaller stuff
 * 
 * Revision 1.19.2.2 2006/03/06 23:16:15 endert Removed warnings!
 * 
 * Revision 1.19.2.1 2006/02/25 22:07:47 wetzker formated
 * 
 * Revision 1.19 2006/02/25 21:44:25 wetzker removed SConf from Player, use
 * SConf.getInstance() instead
 * 
 * Revision 1.18 2006/02/25 12:46:03 wetzker renamed some methods
 * 
 * Revision 1.17 2006/02/24 18:53:56 wetzker used enums for Play_modes and
 * Referee_messages - still has to be improved after creation of new
 * Play_mode-Model - tagged old version removed millions of warnings
 * 
 * Revision 1.16 2006/02/22 16:05:10 endert This is done: - Rebound SoccerScope
 * to Agents (can be added or removed in config-file) - Situations now all
 * extend abstract class Situation - Refactorings: ActionBean _ removed from
 * Attributes - SoccerScope will automatically connect to host given in
 * Start-Call - Trainer uses the same host as soccerscope - Removed unused stuff
 * (old confs, bat, etc.) - Code formatted (good luck when merging) - organized
 * imports - all that i forgot to mention here Revision 1.15 2006/02/13 03:33:10
 * gamel removed output
 * 
 * Revision 1.14 2006/02/06 08:35:50 wetzker added new Scoring Function which
 * still has to be improved after new communication model - improved most models
 * and corrected collision model - made some refactoring - (tagged old version)
 * 
 * Revision 1.13 2006/01/15 18:08:09 phil Coach with heterogenous player typing
 * 
 * Revision 1.12.34.1 2006/01/15 16:50:36 phil *** empty log message ***
 * 
 * Revision 1.12.4.4 2005/12/27 22:31:48 phil added count goals
 * 
 * Revision 1.12.4.3 2005/12/15 02:27:54 kyosu Moved over the ownership of the
 * analyzer to the Tactic (as it has to actively communicate with the outside).
 * This version has been successfully tested to actually 'say' sane player types
 * whenever they changed and it is possible to 'say' a freeform clang message
 * 
 * Revision 1.12.4.2 2005/12/12 00:13:56 kyosu Two aproaches: first by checking
 * who kicked and where the ball was when the player did, and by trying to
 * measure the player_decay of the players...
 * 
 * Revision 1.12.4.1 2005/12/11 16:35:40 kyosu Preps for analyzing the opponents
 * heterogenous player types
 * 
 * Revision 1.12 2005/10/25 20:51:36 endert Added Training-Editor to
 * SoccerScope, restructuring in some old classes and some experimental stuff
 * (goals, commitments, mental model)
 * 
 * Revision 1.11.6.1 2005/10/10 11:05:17 endert New Training-Scenario Editor!
 * There exists a dialog, which opens on middle-mouse click on the field. From
 * here, the Trainings-Scenario may be specified in a more comfortable manner.
 * The Trainings-Scenario is also visualized on the Field - using the
 * TrainingModelLayer. The TrainingModel itself contains all data specified in
 * the scenario, and therefor can be serialized to HDD, using an XML-Stream
 * generator (XStream). The Scenario editor is still under development.
 * 
 * Revision 1.11 2005/08/16 16:26:47 wetzker merged composite branch
 * 
 * Revision 1.9.4.3 2005/07/19 09:56:13 endert Adaptions for Coach (World as
 * Player-Arrays, some methods)
 * 
 * Revision 1.9 2005/06/15 17:03:23 wetzker removed JIAC from Head + changes in
 * framework please report bugs or shortcomings some scenarios might not work
 * because of wrong imports
 * 
 * Revision 1.8.2.4 2005/06/15 14:17:42 wetzker removed println()s
 * 
 * Revision 1.8.2.3 2005/06/15 13:58:37 wetzker *** empty log message ***
 * 
 * Revision 1.8.2.2 2005/06/15 09:14:34 endert Some Changes for the trainer
 * (bugfixes)
 * 
 * Revision 1.8.2.1 2005/06/09 12:32:07 endert Removal of JIAC Libraries and
 * dependencies from project, restructuring the framework and improve some
 * aspects (hoping it is an improvement)
 * 
 * Revision 1.8 2005/05/15 14:40:20 smarqoo added getTeamName(boolean) method
 * 
 * Revision 1.7 2005/05/14 14:06:29 smarqoo safer getters
 * 
 * Revision 1.6 2005/05/08 23:54:22 till added visualCycle to getBall()
 * 
 * Revision 1.5 2005/05/06 02:27:28 smarqoo minor changes, not worth mentioning ;)
 * 
 * Revision 1.4 2005/05/02 20:45:14 haeder - removed some system.out.println()s
 * 
 * Revision 1.3 2005/05/02 20:33:26 haeder + getBall()
 * 
 * Revision 1.2 2005/04/26 00:02:18 smarqoo - trainer works at last! -
 * Interception Point scenario works quite good - lots of changes I don't
 * remember anymore :)
 * 
 * Revision 1.1 2005/04/20 10:39:49 endert Fresh Team Repository installation
 * from /home/e/endert/Robocup to here.
 * 
 * Revision 1.9 2005/03/20 15:06:38 smarqoo - update aural - minor changes &
 * comments
 * 
 * Revision 1.8 2005/03/16 22:28:52 smarqoo - a small bug fixed - some 5000
 * warnings fixed ;)
 * 
 * Revision 1.7 2005/03/13 12:10:36 haeder * using JAVA 5 features for better
 * type safety and code readability
 * 
 * Revision 1.6 2005/02/07 03:21:50 smarqoo new methods: - existsPlayer -
 * getMyFactBase - getPlayersPositions - getPlayMode - setPlayMode
 * 
 * Revision 1.5 2005/02/04 02:45:37 smarqoo - CoachActionBean/Role removed - new
 * methods for the CoachWorld
 * 
 * Revision 1.4 2005/01/10 02:03:04 smarqoo Neues fuer dem Coach, zB eine
 * EyeModeAction
 * 
 * Revision 1.3 2005/01/10 01:09:47 thyrion Added mostly functional CoachParser
 * 
 * Revision 1.2 2005/01/09 13:33:39 ullihtch Implemented methods: update(),
 * updateTeammatesHistory(Vector), updateOpponentHistory(Vektor),
 * updateBallHistory(CoachBallInfo).
 * 
 * Revision 1.1 2005/01/08 23:50:51 smarqoo Der Rest des "Coach-Frameworks". Die
 * Beans, CoachWorld & CoachFactBase gehen ins component.coach
 * 
 * Revision 1.3 2005/01/08 21:30:09 smarqoo CoachPerceptionBean fertig
 * 
 */
